#include <cxxomfort/cxxomfort.hpp>
#include <cxxomfort/cstdint.hpp> // integer types
#include <cxxomfort/library/type_name.hpp>
#include <ccomplex>
#include <iostream>
#include "../library/affixes/complex.hpp"

// reference: 
// https://en.cppreference.com/w/cpp/language/user_literal


template <typename T>
void show (std::ostream& os, T const& t) {
	using namespace std;
	using cxxomfort::library::type_name;
	os<< "[type:"<< type_name<T>()<< " sizeof:"<< sizeof(T)<< " value:"<< t<< " ] "<< endl;
	
}

int main () {
	using namespace std;
	using namespace cxxomfort::library::complex::literals;
	using cxxomfort::library::type_name;
	
	cout<< " 1, int     : "; show(cout, 4); // should be: int
	cout<< " 1, double  : "; show(cout, 4.5); // should be: double
	cout<< " 1, complex : "; show(cout, -3.1415 | i); // should be: complex<double>
	cout<< endl;
	
	// cool thing: they also work as normal functions (function objects)
	cout<< "\n 2 - Using as function objects: foo ( value ) "<< endl;
	show(cout, i(99.999)); // should be: unsigned short
	
	cout<< endl;
	
	// and in C++11 onwards, as literal suffixes
#if (CXXOMFORT_CXX_STD >= 2011)
	cout<< "\n 3 - Using as C++11 suffixes: value_foo "<< endl;
	show(cout, -3.1415_i);
	cout<< endl;
    
    
#endif

}

